package com.xiaoyushu.xiaoyushu.data.align.consumer;

import com.xiaoyushu.xiaoyushu.data.align.constant.MQConstant;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 *  只需保证各自的 Group 名不一样，即可共同消费同一个 Topic, 且集群中只有一个消费者能够消费到 MQ。
 日增量数据落库:笔记点赞,取消点赞
 */
@Component
@RocketMQMessageListener(consumerGroup = "xiaoyushu_group_data_algin_"+ MQConstant.TOPIC_COUNT_NOTE_LIKE,//group组
        topic=MQConstant.TOPIC_COUNT_NOTE_LIKE //主题 Topic
)
@Slf4j
public class TodayNoteLikeIncrementData2DBConsumer implements RocketMQListener<String> {


    /**
     * @param body
     */
    @Override
    public void onMessage(String body) {
        log.info("## TodayNoteLikeIncrementData2DBConsumer 消费到了MQ:{}",body);
    }
}
